<?php
namespace app\service\pay;

use app\strategy\pay\PayInterface;

class PayService
{
    private $strategy;

    /**
     * @param mixed $strategy
     */
    public function setStrategy(PayInterface $strategy)
    {
        $this->strategy = $strategy;
    }

    public function pay($amount, $openID, $orderSn, $body, $subject, $notifyUrl, $orderType)
    {
        return $this->strategy->pay($amount, $openID, $orderSn, $body, $subject, $notifyUrl, $orderType);
    }

    public function refund($orderId, $cancelType)
    {
        return $this->strategy->refund($orderId, $cancelType);
    }
}